﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.Entity;
using FluentNHibernate.Mapping;


namespace PropertyManagement.Domain.Mapping.FluentHibernate
{
    public class InvoiceMap : ClassMap<Invoice>
    {
        public InvoiceMap()
        {
            Table("Invoice");
            Id(x => x.ID).Column("ID").GeneratedBy.Identity();
            Map(x => x.InvoiceNo).Column("InvoiceNo");
            References(x => x.Status).Column("StatusID");
            Map(x => x.TotalAmount).Column("TotalAmount");
            Map(x => x.CreatedBy).Column("CreatedBy");
            Map(x => x.CreatedDate).Column("CreatedDate");
            Map(x => x.IsDeleted).Column("IsDeleted");
            HasMany(x => x.JobBookingList).Cascade.All().KeyColumn("InvoiceID");
        }
    }
}
